sbeditor (Rival to project_json_capabilites)#295
Conversation
… to their blocks)
…sprites without a project)
…l functions to add sprites/blocks/vlbs/other stuff though
|
i might be able to say that this is more powerful that the original proejct_json_capabilites module except that it doesn't have much integration with scratchattach |
…obably want to make a function run when a sprite is assigned, instead of just calling the link function when necessary
|
What is Singleton in this context? |
|
its for a value that says that a block shape is not possible to determine with just opcode (control_stop) (maybe this should be changed) as well as a value that represents the abscence of a sprite so one is automatically assigned (if you are using a with statement with sprite) its a singleton so there is only 1 instance of these classes, so im using the 'is' keyword. i think there is a bit more tesing to do with it since the two singleton instances i mentioned at the start might be the same instance |
|
i should probably add a documentation so other people can understand the stuff because its not a perfectly intuitive system i guess |
|
just checked from scratchattach.editor.build_defaulting import SPRITE_DEFAULT
from scratchattach.editor.blockshape import YESNT
print(SPRITE_DEFAULT is YESNT)returns False: the singletons work as intended |
|
i think 'yesnt' should potentially be renamed |
Signed-off-by: faretek <[email protected]>
# Conflicts: # scratchattach/other/other_apis.py
Signed-off-by: faretek <[email protected]>
|
i keep merging incoming new commits into this branch which makes me worried that i might mess things up |
|
i'll rename yesnt and merge this maybe |
|
there are still more features to be added |
scratchattach.editor (sbeditor v2)
This is my response after seeing
project_json_capabilites.py. Due to various code style issues mentioned in #291, this is an objectively cleaner version (with type hinting and a modular structure inspired byscratchattach.site).I also call it sbeditor v2 because it is a revamp of my old, flawed
sbeditorproject.This pr will remain a draft until the project has reached the same level of capability as
project_json_capabilites.py(it's getting close, and has other features as well).Advantages to
project_json_capabilites.py[sound for sprite in self.sprites for sound in sprite.sounds] + [costume for sprite in self.sprites for costume in sprite.costumes]prim__init__@staticmethodand@propertyAnd more